﻿@model P2PWeb.Controllers.BorrowInfo
@{
    ViewBag.Title = "index";
    Html.EnableUnobtrusiveJavaScript(true);
}
@using P2PWeb.Controllers;
@using P2PWeb.Common;

<link href="~/Content/themes/base/jquery.ui.all.css" rel="stylesheet" />
<link href="@Url.Content("~/Content/borrow.css?ver=0.2")" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery-ui-1.10.4.min.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/app/InterestRate.js")"></script>
<script type="text/javascript" src="@Url.Content("~/Scripts/app/BorrowStep1Form.js")"></script>


<div class="main ">
    <div class="main_top"><span class="main_top_right"></span></div>
    <div class="ouheeMain_box">
        <div class="loan_box">
            <h2 class="content_title ml_neg_75 png">借款申请</h2>
            @*            <h2 class="tit_greenLine manone">
                <span></span>借款申请 </h2>*@
        </div>
        @using (Html.BeginForm("SaveAndNavToStep2", "BorrowStep1"))
        {
            @Html.AntiForgeryToken();
            @Html.HiddenFor(m => m.Id)

            <div class="imhint">
                为了尽快成功借款，请确保信息的真实性，我们将会对您填写的信息进行核实，一旦发现虚假信息将取消您的借款资格！
            </div>
            <div class="ostep">
                <a id="step1" class="complete1"></a>
                <a id="step2" class="   ostep2"></a>
                <a id="step3" class="   ostep3"></a>
            </div>

            <div class="otit">
                借款信息<span>（注：以下信息均为必填）</span>
            </div>

            <li style="display: none;">
                <div class="leftLabel">
                    <label>借款年利率：</label>
                </div>
                <div class="rightLabel">
                    <p style="font-size: 14px;">10%</p>



                    <input name="borrowRate" id="borrowRate" value="10.5" type="hidden">
                </div>
                <span id="err_borrowRate"></span>
            </li>
            <table cellpadding="0" cellspacing="0" border="0" width="100%">
                <tbody>
                    <tr>
                        <td class="td4">借款名称：</td>
                        <td>
                            @Html.TextAreaFor(m => m.Name, new { @class = "input_text3 ots" })
                            @Html.ValidationMessageFor(m => m.Name)
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">借款金额：</td>
                        <td>
                            @Html.TextBoxFor(m => m.BorrowMoney, new { @class = "input_text3 ots" })
                            @Html.ValidationMessageFor(m => m.BorrowMoney, null, new { @class = "error" })
                            <span class="zi">元</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">借款利息：</td>
                        <td>
                            @Html.TextBoxFor(m => m.InterestRate, new { @class = "input_text3 ots" })
                            @Html.ValidationMessageFor(m => m.InterestRate, null, new { @class = "error" })
                            <span class="zi">年利率%</span>
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">投标结束时间：</td>
                        <td>
                            @Html.TextBoxFor(m => m.BorrowDeadline)
                            @Html.ValidationMessageFor(m => m.BorrowDeadline)
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">开始时间：</td>
                        <td>
                            @Html.TextBoxFor(m => m.StartTime)
                            @Html.ValidationMessageFor(m => m.StartTime)
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">结束时间：</td>
                        <td>
                            @Html.TextBoxFor(m => m.EndTime)
                            @Html.ValidationMessageFor(m => m.EndTime)
                        </td>
                    </tr>
                    <tr>
                        <td class="td4">交易类型：
                        </td>
                        <td>
                            @Html.DropDownListFor(m => m.CalcType, new[] 
                       {
                           new SelectListItem(){ Selected=Model.CalcType<1,Text="请选择",Value="-1"},
                           new SelectListItem(){ Selected=Model.CalcType==(int)CalcType.Financing,
                               Text=CalcType.Financing.GetDisplayName(),Value=((int)CalcType.Financing)+""},
                           new SelectListItem(){ Selected=Model.CalcType==(int)CalcType.LookThrough,
                               Text=CalcType.LookThrough.GetDisplayName(),Value=((int)CalcType.LookThrough)+""},
                           new SelectListItem(){ Selected=Model.CalcType==(int)CalcType.WaitForTheRepayment,
                               Text=CalcType.WaitForTheRepayment.GetDisplayName(),Value=((int)CalcType.WaitForTheRepayment)+""},
                               new SelectListItem(){ Selected=Model.CalcType==(int)CalcType.WaitForTheRepayment,
                               Text=CalcType.BuyNow.GetDisplayName(),Value=((int)CalcType.WaitForTheRepayment)+""},
                       }, new { @class = "select_bg valid" })
                            @Html.ValidationMessageFor(m=>m.CalcType)
                        </td>
                    </tr>

                    <tr>
                        <td class="td4">产品类型：
                        </td>
                        <td>
                            @if(ViewData["type"] != null){
                                    @Html.DropDownListFor(m => m.MortgageAttachment, new[] 
                       {
                           new SelectListItem(){ Selected=Model.CalcType<1,Text="请选择",Value="-1"},
                           new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.Car,
                               Text=MortgageAttachment.Car.GetDisplayName(),Value=((int)MortgageAttachment.Car)+""},
                           new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.House,
                               Text=MortgageAttachment.House.GetDisplayName(),Value=((int)MortgageAttachment.House)+""},
                            new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.Credit,
                               Text=MortgageAttachment.Credit.GetDisplayName(),Value=((int)MortgageAttachment.Credit)+""},                               
                               
                       }, new { @class = "select_bg valid" })
                            @Html.ValidationMessageFor(m=>m.MortgageAttachment)
                             }else{
                                     @Html.DropDownListFor(m => m.MortgageAttachment, new[] 
                       {
                           new SelectListItem(){ Selected=Model.CalcType<1,Text="请选择",Value="-1"},
                           new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.Car,
                               Text=MortgageAttachment.Car.GetDisplayName(),Value=((int)MortgageAttachment.Car)+""},
                           new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.House,
                               Text=MortgageAttachment.House.GetDisplayName(),Value=((int)MortgageAttachment.House)+""},
                            new SelectListItem(){ Selected=Model.CalcType==(int)MortgageAttachment.Credit,
                               Text=MortgageAttachment.Credit.GetDisplayName(),Value=((int)MortgageAttachment.Credit)+""},                          
                               
                       }, new { @class = "select_bg valid" })
                            @Html.ValidationMessageFor(m=>m.MortgageAttachment)
                             }

                        </td>
                    </tr>

                    <tr id="zyy-bdnone">
                        <td class="td4" valign="top">借款描述：</td>
                        <td valign="top">
                            @Html.TextAreaFor(m => m.Remark, new { @class = "BorrowRemark ots" })
                            @Html.ValidationMessageFor(m => m.Remark)
                        </td>
                    </tr>
                </tbody>
            </table>
            <div class="obtn02">
                @*<a id="saveBtn" class="osave">保存</a>*@
                <span id="nextBtn" class="onext">提交申请</span>
            </div>
        }

    </div>
    <div class="main_bottom"><span class="main_bottom_right"></span></div>
</div>
